package com.qhg.saas_server.controller;

import com.github.pagehelper.PageInfo;
import com.qhg.saas_server.empty.Result;
import com.qhg.saas_server.mapper.ProductSalesMapper;
import com.qhg.saas_server.pojo.dto.ProductSalesDto;
import com.qhg.saas_server.service.ProductSalesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api("商品销售接口")
@RestController
@RequestMapping("/ProductSales")
@CrossOrigin
public class ProductSalesController {

    @Autowired
    ProductSalesService productSalesService;

    @ApiOperation("根据条件查询商品销售动态")
    @PostMapping
    public Result getProductSalesByConditon(@RequestBody ProductSalesDto productSalesDto){

       PageInfo<ProductSalesDto> pageInfo = productSalesService.getProductSalesByConditon(productSalesDto);
        return Result.success(pageInfo);
    }
}
